from typing import Optional
from pydantic import BaseModel


# 章节
class NovelMenuSchemas(BaseModel):
    novel_id: int               # 小说id
    flg: Optional[int] = None    # 标识


# 返回查询数据
class NovelMenuReturnSchemas(BaseModel):
    id: int
    name: str
    order: int
    drive_name: str

    class Config:
        from_attributes = True


# 记录章节信息
class RecordNovelMenuSchemas(BaseModel):
    chapter_id: int  # 当前章节
    novel_id: int    # 当前数据
    drive_id: Optional[int] = None    # 驱动id


# 添加书籍
class AddBookSchemas(BaseModel):
    address: str    # 书籍地址
    name: str   # 书籍名称
    author: str   # 书籍作者